//
//  LPRequestManager.m
//  ZhongWangYuanApp
//
//  Created by liuyingping on 2018/6/3.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "LPRequestManager.h"

@implementation LPRequestManager
#pragma mark 我的课程
+ (void)request_getMyWaitCoursewareWithstudentid:(NSString *)studentid pageindex:(NSString *)pageindex isfinished:(NSString *)isfinished year:(NSString *)year successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:pageindex forKey:@"pageindex"];
    [paramer setValue:studentid forKey:@"studentid"];
    [paramer setValue:@"10" forKey:@"pagesize"];
    [paramer setValue:isfinished forKey:@"isfinished"];
    [paramer setObject:year forKey:@"year"];
    [YBAFNetWorkingTool postWithUrlString:@"getMyWaitCourseware" Parameter:paramer Success:successBlock Fail:failBlock];
    
}


#pragma mark - 获取最新课程/推荐课程/最热课程
+ (void)request_getcoursewarelistforwcateWithsearchType:(NSString *)searchType pageindex:(NSString *)pageindex pagesize:(NSString *)pagesize successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:pageindex forKey:@"pageIndex"];
    [paramer setObject:searchType forKey:@"searchType"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"studentid"];
    [paramer setValue:pagesize forKey:@"pageSize"];
    [paramer setObject:@"" forKey:@"condation"];
    [paramer setObject:@"" forKey:@"onecate"];
    [paramer setObject:@"" forKey:@"twocate"];
    [paramer setObject:@"" forKey:@"courseType"];
    [paramer setObject:@"0" forKey:@"allCount"];
    [paramer setObject:@"10" forKey:@"maxSize"];
    
    NSString *key = @"getcoursewarelistforwcate";
    if (YBUSERINFOMODEL.studentId.length == 0) {
        key = @"getcoursewarelistforwcateNoSession";
    }
    [YBAFNetWorkingTool postWithUrlString:key Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark - 搜索
+ (void)request_getcoursewarelistforwcateWithcondation:(NSString *)condation pageindex:(NSString *)pageindex threecate:(NSString *)threecate twocate:(NSString *)twocate onecate:(NSString *)onecate year:(NSString *)year successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:pageindex forKey:@"pageIndex"];
    [paramer setValue:@"1" forKey:@"searchType"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"studentid"];
    [paramer setValue:@"10" forKey:@"pageSize"];
    [paramer setValue:condation forKey:@"condation"];
    [paramer setValue:onecate forKey:@"onecate"];
    [paramer setValue:twocate forKey:@"twocate"];
    [paramer setValue:threecate forKey:@"threecate"];
    [paramer setValue:@"" forKey:@"courseType"];
    [paramer setValue:@"0" forKey:@"allCount"];
    [paramer setValue:@"10" forKey:@"maxSize"];
    [paramer setValue:year forKey:@"year"];
    
    [YBAFNetWorkingTool postWithUrlString:@"getcoursewarelistforwcate" Parameter:paramer Success:successBlock Fail:failBlock];
    
}


#pragma mark - 获取学课列表
+ (void)request_getMyClassAndCoursewareWithsuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setObject:YBUSERINFOMODEL.studentId forKey:@"userid"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"studentid"];
   
    
    
    [YBAFNetWorkingTool postWithUrlString:@"getMyClassAndCourseware" Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark - 获取我的收藏
+ (void)request_getMyCollectionClassListUseWeicatAppWithpageindex: (NSInteger)pageindex year:(NSString *)year successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:@(pageindex) forKey:@"pageindex"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"studentid"];
    [paramer setValue:@10 forKey:@"pagesize"];
    [paramer setValue:year forKey:@"year"];
    [YBAFNetWorkingTool postWithUrlString:@"getMyCollectionClassListUseWeicatApp" Parameter:paramer Success:successBlock Fail:failBlock];
}


#pragma mark - 获取我的专题
+ (void)request_getMyClassListUseWeicatAppWithpageindex: (NSInteger)pageindex graduatestatus:(NSString *)status year:(NSString *)year successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:@(pageindex) forKey:@"pageindex"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"userid"];
    [paramer setValue:@10 forKey:@"pagesize"];
     [paramer setValue:@"" forKey:@"keywords1"];
     [paramer setValue:@"" forKey:@"keywords2"];
    if (year) {
        [paramer setValue:year forKey:@"year"];
    }
    if (status) {
        [paramer setValue:status forKey:@"graduatestatus"];
    }
    [YBAFNetWorkingTool postWithUrlString:@"getmyspecial" Parameter:paramer Success:successBlock Fail:failBlock];
}
#pragma mark - 未报名专题班
+ (void)request_getNOApplyInfWithpageindex: (NSInteger)pageindex successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:@(pageindex) forKey:@"pageindex"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"userid"];
    [paramer setValue:@10 forKey:@"pagesize"];
    [paramer setValue:@"%" forKey:@"keywords1"];
    [paramer setValue:@"%" forKey:@"keywords2"];
    [YBAFNetWorkingTool postWithUrlString:@"getPlanClassByUserNewApp" Parameter:paramer Success:successBlock Fail:failBlock];
}
#pragma mark - 获取我的考试
+ (void)request_getIfFinishClassInfoUseWeicatAppWithsuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"userid"];
    [YBAFNetWorkingTool postWithUrlString:@"getIfFinishClassInfoUseWeicatApp" Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark - 获取我的学时
+ (void)request_getmyclassscoreWithyear:(NSString *)year pageindex:(NSInteger)pageindex successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:[NSString stringWithFormat:@"%ld",pageindex] forKey:@"pageindex"];
    [paramer setValue:@"10" forKey:@"pagesize"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"studentid"];
    [paramer setValue:year forKey:@"year"];
    [YBAFNetWorkingTool postWithUrlString:@"getmyclassscore" Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark - 获取首页专题
+(void)request_getMustOrChoiceClassDataListForWCateWithpageindex: (NSInteger)pageindex ifmustclass:(NSString *)ifmustclass pagesize:(NSInteger)pagesize  successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:@(pageindex) forKey:@"pageindex"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"userid"];
    [paramer setValue:@(pagesize) forKey:@"pagesize"];
    [paramer setValue:@"" forKey:@"keywords1"];
    [paramer setValue:@"" forKey:@"keywords2"];
    [paramer setObject:ifmustclass forKey:@"ifmustclass"];
    [YBAFNetWorkingTool postWithUrlString:@"getMustOrChoiceClassDataListForWCate" Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark - 请求司局级必修专题
+(void)request_GetPlanInClassListWithpageindex: (NSInteger)pageindex pagesize:(NSInteger)pagesize  successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:@(pageindex) forKey:@"pageindex"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"userid"];
    [paramer setValue:@(pagesize) forKey:@"pagesize"];
    
    NSString *key = @"GetPlanInClassList";
    if (YBUSERINFOMODEL.studentId.length == 0) {
        key = @"GetPlanInClassListNoSession";
    }
    
    [YBAFNetWorkingTool postWithUrlString:key Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark - 获取我的数据
+(void)request_getUserStudyTimeWithsuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"studentid"];
    [YBAFNetWorkingTool postWithUrlString:@"getUserStudyTime" Parameter:paramer Success:successBlock Fail:failBlock];
}


#pragma mark - 获取课程、专题播放列表，已完成列表，基本信息
//coursewareid 课程ID
//classid专题ID
//enableplaylist true启用获取播放列表，false 不获取播放列表数据

+(void)request_getCoursewareVideoplayWithcoursewareid:(NSString *)coursewareid classid:(NSString *)classid enableplaylist:(NSString *)enableplaylist successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:coursewareid forKey:@"coursewareid"];
    [paramer setValue:classid forKey:@"classid"];
    [paramer setValue:enableplaylist forKey:@"enableplaylist"];
    
    [YBAFNetWorkingTool postWithUrlString:@"getCoursewareVideoplay" Parameter:paramer Success:successBlock Fail:failBlock];
}


#pragma mark - 课程详情里面已完成课程

+(void)request_selectFinishedCoursewareWithpageindex:(NSInteger)pageindex  successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:@(pageindex) forKey:@"pageindex"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"studentid"];
    [paramer setValue:@10 forKey:@"pagesize"];
    
    [YBAFNetWorkingTool postWithUrlString:@"selectFinishedCourseware" Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark -获取二级分类

+(void)request_myStudyAllCourseTwoCategoryWithSuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [YBAFNetWorkingTool postWithUrlString:@"mystudy-allcourse-categoryall" Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark -获取分类

+(void)request_mystudyallcoursecategoryWithfid:(NSString *)fid  successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:fid forKey:@"fid"];
    [YBAFNetWorkingTool postWithUrlString:@"mystudy-allcourse-category" Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark -取消加入待学
+(void)request_deleteToBeStudiedUseWeicatAppWithcoursewareid:(NSString *)coursewareid  successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:coursewareid forKey:@"coursewareid"];
    [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"studentid"];
    [YBAFNetWorkingTool postWithUrlString:@"deleteToBeStudiedUseWeicatApp" Parameter:paramer Success:successBlock Fail:failBlock];
}

#pragma mark -首页轮播接口
+(void)request_getAllbannerImgForAppWithsuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    
    [YBAFNetWorkingTool postWithUrlString:@"getAllbannerImgForApp" Parameter:@{} Success:successBlock Fail:failBlock];
}

#pragma mark - 首页线上线下接口
+(void)request_getIsOnLineAndOfflineClassListWithpageindex:(NSInteger)pageindex pagesize:(NSInteger)pagesize successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary *paramer = [NSMutableDictionary dictionary];
    [paramer setValue:@(pageindex) forKey:@"pageindex"];
    [paramer setValue:@(pagesize) forKey:@"pagesize"];
    
    NSString *key = @"getIsOnLineAndOfflineClassList";
    if (YBUSERINFOMODEL.studentId.length == 0) {
        key = @"GetisonlineandofflineClassListNoSession";
    }else{
        [paramer setValue:YBUSERINFOMODEL.studentId forKey:@"userid"];
    }
    
    [YBAFNetWorkingTool postWithUrlString:key Parameter:paramer Success:successBlock Fail:failBlock];
}

@end
